package cloudoer.blog.controller;

import cloudoer.blog.base.BaseController;
import cloudoer.blog.entity.User;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@RequestMapping("/user")
public class UserController extends BaseController {
    private static Logger logger = Logger.getLogger(UserController.class);

    @RequestMapping("/add")
    @ResponseBody
    public Map<String, Object> add(User user){
        userService.add(user);
        return success("添加成功");
    }

    @RequestMapping("/update")
    @ResponseBody
    public Map<String, Object> update (User user){
        userService.update(user);
        return success("修改成功");
    }
}
